home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Navigation.h
-
- Contains: Navigation Services Interfaces
-
- Version: Technology: System 8
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __NAVIGATION__
- #define __NAVIGATION__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
- #ifndef __FILES__
- #include <Files.h>
- #endif
- #ifndef __EVENTS__
- #include <Events.h>
- #endif
- #ifndef __MIXEDMODE__
- #include <MixedMode.h>
- #endif
- #ifndef __SCRIPT__
- #include <Script.h>
- #endif
- #ifndef __TEXTOBJECTS__
- #include <TextObjects.h>
- #endif
- #ifndef __TIMEOBJECTS__
- #include <TimeObjects.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- #if FOR_SYSTEM8_COOPERATIVE
- #if FOR_PTR_BASED_AE
-
- enum {
- gestaltNavigationServicesAttr = 'nvsv',
- gestaltNavigationServicesPresent = 0
- };
-
- /* Values for the "action" parameter of NavAskSaveChanges */
-
- enum {
- kNavSaveChangesClosingDocument = 1, /* Closing a document */
- kNavSaveChangesQuittingApplication = 2, /* Quitting the app */
- kNavSaveChangesOther = 0 /* Neither closing nor quitting */
- };
-
- typedef UInt16 NavAskSaveChangesAction;
- /* NavFileInfo is the part of NavFileOrFolderInfo for files */
- struct NavFileInfo {
- Boolean locked;
- Boolean resourceOpen;
- Boolean dataOpen;
- Boolean reserved;
- unsigned long dataSize;
- unsigned long resourceSize;
- FInfo finderInfo;
- FXInfo moreFinderInfo;
- };
- typedef struct NavFileInfo NavFileInfo;
-
- /* NavFolderInfo is the part of NavFileOrFolderInfo for folders and volumes */
- struct NavFolderInfo {
- Boolean shareable;
- Boolean sharePoint;
- Boolean mounted;
- Boolean readable;
- Boolean writeable;
- Boolean reserved;
- unsigned long numberOfFiles;
- DInfo finderInfo;
- DXInfo moreFinderInfo;
- };
- typedef struct NavFolderInfo NavFolderInfo;
-
- /* NavFileOrFolderInfo is the structure passed to your filter proc for typeFSS AEDescs */
- struct NavFileOrFolderInfo {
- Boolean isFolder;
- Boolean visible;
- TimeObject creationDate;
- TimeObject modificationDate;
- union {
- NavFileInfo fileInfo;
- NavFolderInfo folderInfo;
- } u;
- };
- typedef struct NavFileOrFolderInfo NavFileOrFolderInfo;
-
- typedef pascal Boolean (*NavEventProcPtr)(const EventRecord *event, void *contextPtr);
- typedef pascal Boolean (*NavObjectFilterProcPtr)(AEDesc *theItem, void *info, void *contextPtr);
-
- #if GENERATINGCFM
- typedef UniversalProcPtr NavEventUPP;
- typedef UniversalProcPtr NavObjectFilterUPP;
- #else
- typedef NavEventProcPtr NavEventUPP;
- typedef NavObjectFilterProcPtr NavObjectFilterUPP;
- #endif
- struct NavDialogOptions {
- Point location; /* Top-left of the dialog, or (-1, -1) for default position */
- TextObject banner; /* Optional banner text displayed in the dialog */
- TextObject defaultButtonLabel; /* Label of the default button (or null string for default) */
- void * customPanel; /* Custom SOM panel to be inserted, if any */
- };
- typedef struct NavDialogOptions NavDialogOptions;
-
- struct NavReplyRecord {
- Boolean validRecord; /* True if the user confirmed the selection, false on cancel */
- Boolean replacing; /* True if we are overwriting an existing object (put only) */
- AEDesc selection; /* AppleEvent descriptor of the selected object */
- };
- typedef struct NavReplyRecord NavReplyRecord;
-
- /* return values from NavAskSaveChanges, NavCustomAskSaveChanges */
-
- enum {
- askSaveChangesSave = 1,
- askSaveChangesCancel = 2,
- askSaveChangesDontSave = 3
- };
-
- typedef UInt16 NavAskSaveChangesResult;
- /*
- To specify which types of data you are willing to receive, use the NavTypeList.
- *
- * This is not a list of file types; that must be specified in an 'open' resource
- * if you are displaying files, or you can use a filter procedure. It is a list of
- * AEDesc types. Only items which can be coerced to these descriptor types will be
- * displayed in the list, descended into as containers, or returned in a reply.
- * The list is terminated by a null entry and may be of any length. At present
- * only typeFSS and typeAlias are supported.
- *
- * If you include typeAlias in the list, then aliases of all types will be allowed,
- * and aliases will not be resolved before they are given to you. Otherwise, aliases
- * will be resolved internally and you will be passed their resolved AEDescs if
- * they can be coerced into one of the types you want.
- */
- typedef DescType NavTypeList[4];
- typedef const DescType *ConstNavTypeListPtr;
- /*
- * Navigation Services Dialogs
- */
- extern pascal OSErr NavAskSaveChanges(ConstTextObject applicationName, ConstTextObject documentName, NavAskSaveChangesAction action, NavAskSaveChangesResult *reply, Point location, NavEventUPP eventProc, void *contextPtr);
-
- extern pascal OSErr NavCustomAskSaveChanges(ConstTextObject message, NavAskSaveChangesResult *reply, Point location, NavEventUPP eventProc, void *contextPtr);
-
- extern pascal OSErr NavGetObject(const AEDesc *defaultObject, NavReplyRecord *reply, NavDialogOptions *dialogOptions, short openResourceID, ConstNavTypeListPtr typeList, NavObjectFilterUPP filterProc, NavEventUPP eventProc, void *contextPtr);
-
- extern pascal OSErr NavPutObject(const AEDesc *defaultObject, NavReplyRecord *reply, NavDialogOptions *dialogOptions, NavEventUPP eventProc, void *contextPtr);
-
- /*
- * Generating unique file names
- */
- extern OSErr MakeUniqueNameInFolder(FSSpec *folder, TextObject *name);
-
-
- #if GENERATINGCFM
- #else
- #endif
-
- enum {
- uppNavEventProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const EventRecord *)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *))),
- uppNavObjectFilterProcInfo = kPascalStackBased
- | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
- | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(AEDesc *)))
- | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(void *)))
- | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(void *)))
- };
-
- #if GENERATINGCFM
- #define NewNavEventProc(userRoutine) \
- (NavEventUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppNavEventProcInfo, GetCurrentArchitecture())
- #define NewNavObjectFilterProc(userRoutine) \
- (NavObjectFilterUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppNavObjectFilterProcInfo, GetCurrentArchitecture())
- #else
- #define NewNavEventProc(userRoutine) \
- ((NavEventUPP) (userRoutine))
- #define NewNavObjectFilterProc(userRoutine) \
- ((NavObjectFilterUPP) (userRoutine))
- #endif
-
- #if GENERATINGCFM
- #define CallNavEventProc(userRoutine, event, contextPtr) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppNavEventProcInfo, (event), (contextPtr))
- #define CallNavObjectFilterProc(userRoutine, theItem, info, contextPtr) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppNavObjectFilterProcInfo, (theItem), (info), (contextPtr))
- #else
- #define CallNavEventProc(userRoutine, event, contextPtr) \
- (*(userRoutine))((event), (contextPtr))
- #define CallNavObjectFilterProc(userRoutine, theItem, info, contextPtr) \
- (*(userRoutine))((theItem), (info), (contextPtr))
- #endif
- #endif
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __NAVIGATION__ */
-
-